
class Solution:
    def maxArea(self, height) -> int:
        maxindex=0
        water=0
        for i in range(len(height)):
            if height[i]>=height[maxindex]:
                maxindex=i
        direction=True
        for left in range(0,maxindex+1):
            for right in range(maxindex,len(height)):
                water=max(water,(maxindex-left)*min(height[maxindex],height[left]),(right-maxindex)*min(height[maxindex],height[right]),(right-left)*min(height[right],height[left]))
        return water


s=Solution()
s.maxArea([8,10,14,0,13,10,9,9,11,11])


class Solution:
    def maxArea(self, height: List[int]) -> int:
        l, r = 0, len(height) - 1
        ans = 0
        while l < r:
            area = min(height[l], height[r]) * (r - l)
            ans = max(ans, area)
            if height[l] <= height[r]:
                l += 1
            else:
                r -= 1
        return ans


'''
明明接近结果的思路的我却没有顺着做，不应该
'''